function Progress(){
    var max = 100;
    var current = 0;
    var isOver = false;
    var lastCount = 0;
    var box =  util.createTag("div", "progressBox");
    var block = util.createTag("div", "progressBlock");
    var overEvent = function(){

    }
    function init(){
        $(block).css("width", "0%");
        $(box).css("opacity", "1");
        current = 0;
        lastCount ++;
    }
    function next(){
        var step = Math.max((max - current)/25, 0.6);
        if (!isOver){
            step = (max - current) / 500;
            if ( current > 70){
                step = step / 2;
            }
            if (current > 90){
                step = step / 2;
            }
            if (current > 95){
                step = 0;
            }
        }
        current += step;
    }
    function render(count){
        if (count != lastCount){
            return;
        }
        next();
        $(block).css("width", current+"%");
        if (current > 99){
            $(block).css("width", "100%");
            overEvent();
            isOver = false;
            $(box).animate({opacity:'0'},1300,'swing');
        }
        else{
            requestAnimationFrame( function(){render(count)} )
        }
    }
    return {
        end: function(){
            isOver = true;
        },
        render: function(elem){
            box.append(block);
            elem.appendChild(box);
        },
        start: function(){
            init();
            var count = lastCount;
            render(count);
        },
        setEvent: function(func){
            overEvent = func;
        }
    }
}